Replace sox with ffmpeg for audio conversion and filtering#2
Merged
Conversation
Use ffmpeg for converting audio to raw PCM and for bandpass filtering. The bandpass filter uses ffmpeg's sinc FIR kernel generator with afir convolution, which closely matches sox's sinc filter quality (steep rolloff, flat passband, linear phase). Updates README and CI workflow to reference ffmpeg instead of sox.
farski
approved these changes
Apr 2, 2026
Member
farski
left a comment
There was a problem hiding this comment.
With the caveat that I didn't investigate those FFmpeg filters very much, and I have no experience with FIR, this all seems reasonable
The irnorm option was added in ffmpeg 7.x. Dropping it makes the bandpass filter work with Ubuntu's ffmpeg 6.1.1 package without affecting detection results.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use ffmpeg for converting audio to raw PCM and for bandpass filtering.
The filter options between the 2 are not quite the same - the
bandpassfilter in ffmpeg is not equivalent.This implementation uses ffmpeg's sinc FIR kernel generator with afir convolution, which closely matches sox's sinc filter quality (steep rolloff, flat passband, linear phase).
Makes the change to the code, and updates README and CI workflow to reference ffmpeg instead of sox.